package controller;

import jakarta.annotation.Resource;
import org.apache.catalina.User;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

public class ExampleController {
    @Resource
    private IUserService userService;
    @GetMapping(value = "/hello/{id}")
    public String getUser(@PathVariable("id") Long userId, Model model){
        User user = userService.getUser(userId);
        model.addAttribute("user",user);
        return "demo/hello";
    }
}
